<#import "../space_macro.ftl" as space />
<#include "../header.ftl" />
<#import "/META-INF/mspring.ftl" as mspring />
		<@side.sidenav active="评论管理"/>
	    <div class="g-content">
	        <div class="g-content-container">
	            <div class="g-p">
					<div class="m-crumb">
					    <ul class="f-cb">
					        <li><i>&gt;</i><a href="#">博客管理</a></li>
					        <li><i>&gt;</i><a href="#">评论管理</a></li>
					    </ul>
					</div>
					<div class="m-content">
						<form name="commentForm" id="commentForm" action="${spaceUrl}/admin/comment/list" method="GET">
							<@spring.bind "commentPage" />
							<!-- pagination parameter -->
							<@spring.formHiddenInput path="commentPage.pageNo" />
							<@spring.formHiddenInput path="commentPage.totalPages" />
							<@spring.formHiddenInput path="commentPage.totalCount" />
							<!-- sorter parameter -->
							<@spring.formHiddenInput path="commentPage.sortEnable" />
							<@spring.formHiddenInput path="commentPage.sort.field" />
							<@spring.formHiddenInput path="commentPage.sort.order" />
							
						    <table class="m-table">
						        <thead>
						            <tr>
						                <th width="20%">文章标题</th>
						                <th width="45%">内容</th>
						                <th width="15%">评论人</th>
						                <th width="10%">状态</th>
						                <th width="5%">操作</th>
						            </tr>
						        </thead>
						        <tbody>
						        	<#if (commentPage?exists && commentPage.result?size > 0)>
							        	<#list commentPage.result as comment>
								        	<tr <#if comment_index % 2 == 0>class="even"</#if>>
								                <td>
									                <a target="_blank" href="<@postUrl id=comment.post.id />" >
									                <@mspring.sub_string content=comment.post.title to=15 suffix="..." />
									                </a>
								                </td>
								                <td><@mspring.sub_string content=comment.content to=30 suffix="..." /></td>
								                <td><a href="${spaceUrl}" >${comment.author}</td>
								                <td>
								                <#if comment.status == "approved">审核通过</#if>
								                <#if comment.status == "wait_for_approved">等待审核</#if>
								                <#if comment.status == "spam">垃圾评论</#if>
								                <#if comment.status == "recycle">回收站</#if>
								                </td>
								                <td>修改</td>
								            </tr>
							        	</#list>
						        	</#if>
						        </tbody>
						    </table>
						    <#if (commentPage.totalPages > 1)>
		                        <@space.pagenavi pageEntity=commentPage baseUrl=spaceUrl + "/admin/comment/list?pageNo=$page$" />
		                    </#if>
						</form>
					</div>
	            </div>
	        </div>
	    </div>
<#include "../footer.ftl" />